# -*- conding:UTF-8 -*-

'''
@ Project: P8_lxpro_7.7
@ File: tasks.py
@ Author: 罗婷
@ Date：2022/7/7 15:12

'''

from ronglian_sms_sdk import SmsSDK

from common.celery.celery_main import app

accId = '8a216da8804ba8a5018064a39933069b'
accToken = '09880a5e3fc94046b3cc147e240ad169'
appId = '8a216da8804ba8a5018064a39a3706a2'

@app.task
def send_sms(mobile, sms_code, expire=60):
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    mobile = mobile
    datas = (f'{sms_code}', f'{expire}')
    res = sdk.sendMessage(tid, mobile, datas)
    if res:
        return True
    else:
        return False










